package com.bigdata.controller;

import com.bigdata.entity.vo.AppFlowTrackingVO;
import com.bigdata.entity.vo.ProvinceTrafficQualityVO;
import com.bigdata.entity.pojo.Result;
import com.bigdata.service.NetworkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/network")
public class NetworkController {
    @Autowired
    private NetworkService networkService;
    @GetMapping("/traffic/track")
    public Result<AppFlowTrackingVO> getNetworkFlowTracking(){
        AppFlowTrackingVO appFlowTrackingVO = networkService.NetworkFlowTracking();
        System.out.println(appFlowTrackingVO);
        return Result.success(appFlowTrackingVO);
    }
    @GetMapping("/quality/stats")
    public Result<ProvinceTrafficQualityVO>getProvinceTrafficQuality(){
        System.out.println(networkService.ProvinceTrafficQuality());
     return Result.success(networkService.ProvinceTrafficQuality());
    }
}
